Test-Series - programming logic

Test Number 11/15

Q: Which of the following is always true about the function area?

//assume all header files are included

int area(double radius)
{
return PI*radius*radius;
}
A. It returns the area of a circle within the limits of precision of double, or the constant PI, whichever is lower.
B. It returns the area of a circle within the limits of double precision.
C. It returns the area of a circle within the limits of the constant PI.
D. None of the above.
Solution: The correct answer is:
None of the above.
Q: Which of the following converts source code into machine code at each runtime?
A. object encoder
B. interpreter
C. compiler
D. linker
Solution: The correct answer is:
 interpreter
Q: Which of these is not a data type?
A. boolean
B. character
C. integer
D. array
Solution: The correct answer is:
array
Q: Today is Tuesday. It is raining. Which of the following is True?
A. NOT (Raining OR Tuesday)
B. Raining XOR Tuesday
C. Raining OR Tuesday
D. Raining AND Tuesday
Solution: The correct answer is:
Raining OR Tuesday
Q: An integer X is saved as an unsigned 8-bit number, 00001011.What is X?
A. 10
B. 15
C. 11
D. 22
Solution: The correct answer is:
11
Q: In a sequential programming language, code statements are executed in which order?
A. From bottom to top
B. From top to bottom
C. None of these
D. All are executed simultaneously
Solution: The correct answer is:
From top to bottom
Q: What does this function compute for positive n?

//assume all header files are included

{
if (n equals 1)
{return 1}
else
{return f(n-1)/f(n-1)+n}
}
A. 1 + n, if n > 1, 1 otherwise
B. 1 + 2 + 3 + ... + n
C. 1 + n
D. None of the above
Solution: The correct answer is:
1 + n, if n > 1, 1 otherwise
Q: Which of the following commonly happens to variables (in most languages)?
A. expansion
B. derivation
C. declaration
D. assignment
Solution: The correct answer is:
declaration
Q: Which is a typical kind of variable for keeping an ordered set of values in memory, that can be referenced as e.g. A[3], A[n+1] etc. ?
A. File
B. Array
C. Container
D. String
Solution: The correct answer is:
Array
Q: There are two loops which are nested. This implies which one of the following?
A. Two loops, one inside the others
B. Two loops with the same iteration count
C. Two loop, one after the other
D. One loop with two different iteration counts
Solution: The correct answer is:
Two loops, one inside the others

You Have Score    /10